<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.blockchain.front.service.financial.entity.RechargeQrEntity"%>
<%@page import="com.blockchain.front.servlets.financial.Charge"%>
<%@page import="java.util.Random"%>
<%@page import="java.text.DecimalFormat"%>
<%@page import="com.blockchain.common.enums.ChargeStatus"%>
<%@page import="com.blockchain.common.enums.ChargeType"%>
<%@page import="com.blockchain.front.servlets.financial.CnyTx"%>
<%@page import="com.blockchain.front.service.financial.entity.TxRecordEntity"%>
<%@page import="com.blockchain.common.enums.WithdrawStatus"%>
<%@page import="com.blockchain.front.servlets.security.Bank"%>
<%@page import="com.blockchain.front.service.security.entity.BankCard"%>
<%@page import="com.blockchain.front.service.financial.entity.UserZhEntity"%>
<%@page import="com.blockchain.front.servlets.SendVice"%>
<%@page import="com.blockchain.front.servlets.Send"%>
<%@page import="com.blockchain.front.servlets.security.Qbbz"%>
<%@page import="com.blockchain.front.service.financial.entity.XlbEntity"%>
<%@page import="com.blockchain.util.http.URLParameter"%>
<%@page import="com.blockchain.front.servlets.financial.AbstractFinancialServlet"%>
<%@page import="com.blockchain.front.service.AbstractFrontService"%>
<%@page import="com.blockchain.front.servlets.AbstractFrontServlet"%>
<%@page import="com.blockchain.front.service.financial.entity.JlEntity"%>
<%@page import="com.blockchain.common.enums.JyztStatus"%>
<%@page import="com.blockchain.front.service.security.entity.QbdzEntity"%>
<%@page import="com.blockchain.front.service.security.SecurityManage"%>
<%@page import="com.blockchain.front.service.financial.FinancialManage"%>
<html>
<head>
<%
String str = languageDefine.getValue(request, "eurRecharge_eurRecharge");
String _TITLE_ = str + "- "+configureProvider.getProperty(SystemVariable.SITE_NAME);
CURRENT_SUB_CATEGORY="RMBCZ";
PC_TITLE_NAME="RMBCZ";
URLParameter parameter = new URLParameter(request,controller.getViewURI(request,CnyCz.class));
SecurityManage securityManage = serviceSession.getService(SecurityManage.class);
ChargeStatus zt=EnumParser.parse(ChargeStatus.class, request.getParameter("zt"));
ChargeType type=EnumParser.parse(ChargeType.class,null);
FinancialManage manage=serviceSession.getService(FinancialManage.class);
RechargeQrEntity qrEntity =  manage.searchRechargeQr();
final int currentPage = IntegerParser.parse(request.getParameter("paging.current"));
BankCard[] bs=securityManage.bankList();
 PagingResult<TxRecordEntity> searchCzjl=manage.searchCzjl(type,zt,new Paging() {
	public int getCurrentPage() {
		return currentPage;
	}

	public int getSize() {
		return 5;
	}
});
 TxRecordEntity[] search=searchCzjl.getItems(); //列表  
 BigDecimal min=BigDecimalParser.parse(configureProvider.getProperty(SystemVariable.CHARGE_MIN_AMOUNT));
%> 
<title><%=_TITLE_ %></title>
<%@include file="/WEB-INF/include/meta.jsp"%>
<%@include file="/WEB-INF/include/style.jsp"%>
<%@include file="/WEB-INF/include/authenticatedSession.jsp"%>
</head>
<%@include file="/WEB-INF/include/header.jsp"%>
<div class="autobox">
    <div class="now">
         <a href="<%=controller.getViewURI(request, com.blockchain.front.servlets.Index.class)%>" class="orange"><%=languageDefine.getValue(request, "menu_home")%></a> &gt; <a href="<%=controller.getViewURI(request,com.blockchain.front.servlets.financial.index.class)%>" class="orange"><%=languageDefine.getValue(request, "menu_financeCenter")%> </a> &gt; <%=languageDefine.getValue(request, "eurRecharge_eurRecharge")%>
    </div>
    <div class="assets_center clear po_re zin70">
        <!--左侧菜单-->
        <div class="coin_menu">
    <div class="coin_menu_box">
        <ul>
            <li id="finance_index"><i class="coin_menu_op_0_1"></i><%=languageDefine.getValue(request, "eurRecharge_eurRecharge")%></li>
        </ul>
    </div>
     <%@include file="/WEB-INF/include/financial/left.jsp"%>	
</div>
        <!--右侧内容-->
        <div class="assets_content w900 right bg_w">
            <div class="safe_center clear" style="padding-left: 0px;">
                <h1 style="margin-top: 0px; margin-bottom: 15px; line-height: 15px;" href="#tab1"><%=languageDefine.getValue(request, "eurRecharge_eurRecharge")%></h1>
            </div>
                <div class="mytips">
                <h6 style="color: #ff8000;"><%=languageDefine.getValue(request, "rmbRecharge_tips")%></h6>
                <p style="font-size:14px;">
                    <span style="color:#E53333;">
                    1、限额说明：每次最低充值<%=min%>USDZ；<br />
                    2、转账汇款时，请严格按照金额录入（包括小数点后两位），并且在汇款的【备注/附言】栏目填写汇款备注的数字，否则不能入账；<br />
                    3、转账汇款成功后，工作日9:00-18:00，40分钟内入账，节假日顺延；<br />
                    </span>
                </p>
            </div>
           <form action="<%=controller.getURI(request, CnyCz.class)%>" method="post" id="form" >
            <div class="choosepaymethod">
                 <a href="<%=controller.getViewURI(request, CnyCz.class)%>" style="cursor:pointer;" class="wycz_cz active"  id="outline">转账充值(人工到账)</a>
                
                <div class="choosebanks"  id="JKDiv_1">
                    <div id="czxx" class="methodway clearfix" style="padding-top:18px;display:block;" >
                        <div class="w_div clearfix">
                            <div class="w1"><%=languageDefine.getValue(request, "rmbRecharge_rechargeMethod")%>：</div>
                            <div class="w2">
                                <select class="mycz-type" name="type" id="mycz_type" style="width: 200px; height: 38px;border-radius: 8px;">
                                    <option value="QR"><%=languageDefine.getValue(request, "rmbRecharge_qrcode")%></option>
                                </select>
                            </div>
                        </div>
                        <%
                        DecimalFormat df = new DecimalFormat("#.00");
                        String ss=df.format(Math.random());
                        double c=DoubleParser.parse(ss);
                        if(c==0){
                        	c=0.1;
                        }if(c==1){
                        	c=c-0.1;
                        }
                        
                        %>
                        <div class="w_div clearfix" >
                            <div class="w1"><%=languageDefine.getValue(request, "rmbRecharge_rechargeAmount")%>(￥)：</div>
                            <div class="w2">
                                <span style="position: relative;" class="cc2">
                                    <input type="text" name="czje" class="cztxinput" id="mycz_amount" value="" placeholder="" style="width:160px;padding-right:30px;border-radius: 8px;text-align:right;" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                    <div style="position: absolute;right: 0;top: 0;font-size: 14px;color: #333;font-weight: 700;width: 30px;">
                                        <input type="text" disabled="disabled"  value="<%=df.format(c)%>"  class="random" style="color:#e55601; border:0; box-shadow: none;">
                                    	<input type="hidden" name="sjxs" value="<%=c%>">
                                    	<input type="hidden" name="name" value="未填写">
                                    	<input type="hidden" name="zh" value="未填写">
                                    </div>
                                </span>
                            </div>
                            <div class="w2" style="color:#EA6647;line-height:33px;padding-left :5px;"><%=languageDefine.getValue(request, "rmbRecharge_minimumRecharge")%><%=Formater.formatAmount(min)%><%=languageDefine.getValue(request, "rmbRecharge_yuan")%></div>
                        </div>
                        <div class="w_div clearfix" >
                            <div class="w1">&nbsp;</div>
                            <div class="w2">
                                <input type="button"  class="btn-cztx" id="btn-submit" value='<%=languageDefine.getValue(request, "rmbRecharge_immediateRecharge")%>' title='<%=languageDefine.getValue(request, "rmbRecharge_immediateRecharge")%>' onclick="Update();" style="border-radius: 8px;">
                            </div>
                        </div>
                    </div>
                    <div id="dialog_ali" class="" style="width: 650px; overflow: visible; display:none;position:relative;">
                    <%
                    String ddid=request.getParameter("ddid");
                    BigDecimal czje=BigDecimalParser.parse(request.getParameter("cjje"));
                    %>
                        <div class="mana-app-title" style="line-height: 34px;"><%=languageDefine.getValue(request, "rmbRecharge_onlineBankRemittance")%> 
                        <span id="wait" style="color:#e55600;">（<%=languageDefine.getValue(request, "rmbRecharge_unpaid")%>）</span>
                        </div>

                            <table class="mana-app-table info" style="width: 90%;padding-top:0;">
                                <tbody>
                                <%if(request.getParameter("type")!= null && (request.getParameter("type").equals("qr"))){%>
                                <tr>
                                    <td width="175"><%=languageDefine.getValue(request, "rmbRecharge_officialAccount")%>：</td>
                                    
                         			<td><img style="width:170px;" src="<%if(!StringHelper.isEmpty(qrEntity.fir)){%><%=fileStore.getURL(qrEntity.fir)%><%}%>"></td>
                         			<td><img style="width:170px;" src="<%if(!StringHelper.isEmpty(qrEntity.sec)){%><%=fileStore.getURL(qrEntity.sec)%><%}%>"><td>
                                    
                                </tr>
                                <tr>
                                    <td width="175"></td>
                                    <td><span>( 1 )</span></td>
                                    <td><span>( 2 )</span></td>
                                </tr>
                                <%} else {%>
                                
                               <tr>
                                    <td><%=languageDefine.getValue(request, "rmbRecharge_account")%>：</td>
                                    <td>
                                        <b id="right_cny">6212261402020664626</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td><%=languageDefine.getValue(request, "rmbRecharge_bank")%>：</td>
                                    <td>
                                        <b id="right_cny">工商银行</b>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td><%=languageDefine.getValue(request, "rmbRecharge_comp")%>：</td>
                                    <td>
                                        <b id="right_cny">MD MAZHARUL ISLAM</b>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td><%=languageDefine.getValue(request, "rmbRecharge_build")%>：</td>
                                    <td>
                                        <b id="right_cny">福建福州闽侯上街支行</b>
                                    </td>
                                </tr>
                                
                                <%} %>
                                <tr>
                                    <td><%=languageDefine.getValue(request, "recharge_moneyCNY")%>：</td>
                                    <td>
                                        <b id="right_cny"><%=Formater.formatAmount(czje)%></b> (￥)
                                    </td>
                                </tr>

                                <tr>
                                    <td><%=languageDefine.getValue(request, "rmbRecharge_remittanceNotes")%>：</td>
                                    <td>
                                    <em class="cnyin_msg" style="color:red;font-style:normal;font-weight: bold;"><%StringHelper.filterHTML(out,ddid);%></em>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>
                                        <a class="hk-btn btns2 mt10" onclick="myczHuikuan()" href="javascript:void(0)"><%=languageDefine.getValue(request, "rmbRecharge_hadRemittance")%></a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        
                        <div style="clear: both"></div>
                        <div class="pay_con">
                            <span></span>

                            <div class="pay_con_r">

                                <p style="font-weight: bold;color: #396;"><%=languageDefine.getValue(request, "rmbRecharge_pleaseOpen")%></p><p style="font-weight: bold;color: #396;">
                                    <%=languageDefine.getValue(request, "rmbRecharge_andInNotes")%>：<em class="cnyin_msg" style="font-weight: bold;color:#e55600;font-style:normal;color:red;"><%StringHelper.filterHTML(out,ddid);%></em><br>
                                    <%=languageDefine.getValue(request, "rmbRecharge_noAnd")%><br>
                                    <%=languageDefine.getValue(request, "rmbRecharge_howLong")%></p>
                            </div>

                        </div>
                    </div>
                </div>
        </div>
                <div class="f_body">
                    <table class="f_table" id="investLog_content">
                        <thead>
                        <tr>
                        	<th width=""><%=languageDefine.getValue(request, "rmbRecharge_rechargeOrder")%></th>
                            <th width=""><%=languageDefine.getValue(request, "rmbRecharge_rechargeTime")%></th>
                            <th width=""><%=languageDefine.getValue(request, "rmbRecharge_rechargeMethod")%></th>
                            <th width=""><%=languageDefine.getValue(request, "rmbRecharge_rechargeAmount")%>(CNY)</th>
                            <th width=""><%=languageDefine.getValue(request, "rmbRecharge_actualAccount")%>(USDZ)</th>
                            <th width="">
                            <select name="zt" id="status-selectTest">
                            <option  value=""><%=languageDefine.getValue(request, "rmbRecharge_status")%></option>
                            <%for(ChargeStatus zs:ChargeStatus.values()){%>
                                <option <%if(zs.name().equals(String.valueOf(zt))){%> selected="selected"<%}%> value="<%=zs.name()%>"><%=backgroundDataFlag==1?zs.getName():backgroundDataFlag==2?zs.getNameEn():zs.getNameTw()%></option>
                             <%}%>
                            </select></th>
                        </tr>
                        </thead>
                        <tbody>
                  <%if(search!=null){for(TxRecordEntity s:search){%> 
            <tr>
            	<td><%=s.id%></td>
                <td><%=TimestampParser.format(s.sqsj)%></td>
                <td><%=backgroundDataFlag==1?s.chargeType.getName():backgroundDataFlag==2?s.chargeType.getNameEn():s.chargeType.getNameTw()%></td>
                <td><%=Formater.formatAmount(s.czje)%></td>
                <td><%=Formater.formatAmount(s.cny)%></td>
                <td><%=backgroundDataFlag==1?s.chargeStatus.getName():backgroundDataFlag==2?s.chargeStatus.getNameEn():s.chargeStatus.getNameTw()%></td>
            </tr>
            <%}}%>
                  </tbody>
                    </table>
                   <%AbstractFinancialServlet.rendPaging(out, searchCzjl,controller.getPagingURI(request,CnyCz.class),parameter.getQueryString());%>
                </div>
                </form>
            </div>
    </div>
</div>
<%@include file="/WEB-INF/include/footer.jsp"%>
<%@include file="/WEB-INF/include/script.jsp"%>
<script type="text/javascript">
var min=<%=min%>;
 $("#status-selectTest").change(function () {
	$("#form").attr("action",'<%=controller.getViewURI(request, CnyCz.class)%>');	
	$("#form").submit();
});
	function Update() {
        var addr = $('#mycz_type option:selected').val();
        var mycz_name = $("#mycz_name").val();
        var mycz_amount = $("#mycz_amount").val();
        var mycz_zh = $("#mycz_zh").val();
        if (addr == "" || addr == null||addr=='tianjia') {
            layer.tips('<%=languageDefine.getValue(request, "js_rechargeMethod")%>', '#mycz_type', {tips: 3});
            return false;
        }
        if (mycz_amount == "" || mycz_amount == null) {
            layer.tips('<%=languageDefine.getValue(request, "js_rechargeAmount")%>', '#mycz_amount', {tips: 3});
            return false;
        }
        if(mycz_amount<min){
        	layer.tips('<%=languageDefine.getValue(request, "js_rechargeAmountLessThanMin")%>'+min+'', '#num', {tips: 3});
            return false;
        }
        $("#form").submit(); 
	    }
	   
	function myczHuikuan(){
		$("#dialog_ali").hide();
		$("#czxx").show();	
	}
	
	function keyUpToDo(obj){
		var value=obj.value.replace(/[^0-9.]/g,'');
		obj.value=value;
		value=value.replace(/\.\d{6,}$/,value.substr(value.indexOf('.'),7));
		var add2 = $("input[name='sjxs']").val();
		var allCount = parseFloat(value)+parseFloat(add2);
		$("#toRate").text(accMul(allCount,<%=configureProvider.get("SYSTEM.EUR_CNY_RATE")%>));
	}

	/**
	 * 精确计算两个浮点数相乘(四舍五入) 
	 */
	function accMul(arg1,arg2) {  
	    var m=0,s1=arg1.toString(),s2=arg2.toString();  
	    try{m+=s1.split(".")[1].length}catch(e){}  
	    try{m+=s2.split(".")[1].length}catch(e){}  
	    return (Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)).toFixed(2);
	}
	
<%String error = controller.getPrompt(request,response,PromptLevel.ERROR);if(!StringHelper.isEmpty(error)){%>
	layer.open({
	title: '<%=languageDefine.getValue(request, "js_tip")%>',
	content: '<%=languageDefine.getValue(request,error)%>'
});  
<%}%>

<%String info = controller.getPrompt(request,response,PromptLevel.INFO);if(!StringHelper.isEmpty(info)){%>
$("#dialog_ali").show();
$("#czxx").hide();
<%}%>

</script>
</body>
</html>	
	
